@use "utils/functions";
@use "utils/variables";

.post-menu {
    position: absolute;
    z-index: 6;
    top: -12px;
    right: 0;
    display: flex;
    justify-content: flex-end;
    padding: 4px;
    border: 1px solid transparent;
    border-radius: 4px;

    // Counteract the margins added to ul in _typography.scss
    margin-top: 0;
    margin-bottom: 0;

    list-style: none;
    white-space: normal;
}

.post-menu__item {
    display: inline-flex;
    width: 28px;
    height: 28px;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: rgba(functions.v(center-channel-color-rgb), 0.4);
    fill: rgba(functions.v(center-channel-color-rgb), 0.4);

    &:active,
    &--active,
    &--active:hover {
        background: rgba(var(--button-bg-rgb), 0.08);
        color: functions.v(button-bg);
        fill: functions.v(button-bg);
    }

    span {
        display: flex;
    }
}

.post-menu__item--show {
    display: block;
}

.post-menu__item--wide {
    width: auto;
    padding: 0 6px;
}

.post-menu__item--selected { // Used for the flag icon when it is in the flagged state
    color: var(--link-color);
    fill: var(--link-color);
}

.post-menu__comment-count {
    margin: 0 0 0 2px;
    font-weight: 600;
    -webkit-user-select: none; /* Chrome all / Safari all */
    -moz-user-select: none;    /* Firefox all */
    -ms-user-select: none;     /* IE 10+ */
    user-select: none;
}

.post-menu__emoticon {
    cursor: pointer;
}

@media (min-width: 768px) {
    .post-menu__item {
        display: none;
    }

    .post-menu__item--show {
        display: block;
    }

    .post {
        &:hover,
        &.post--hovered,
        &.a11y--active {
            .post-menu {
                border-color: rgba(var(--center-channel-color-rgb), 0.2);
                background-color: functions.v(center-channel-bg);
                box-shadow: variables.$elevation-1;
            }

            .search-item__jump {
                color: rgba(functions.v(center-channel-color-rgb), 0.75);

                &:hover {
                    color: functions.v(link-color);
                }
            }

            .post-menu__item {
                display: inline-flex;
                color: rgba(functions.v(center-channel-color-rgb), 0.64);
                fill: rgba(functions.v(center-channel-color-rgb), 0.64);

                &:hover {
                    background: rgba(functions.v(center-channel-color-rgb), 0.08);
                    color: rgba(functions.v(center-channel-color-rgb), 0.8);
                    fill: rgba(functions.v(center-channel-color-rgb), 0.8);
                }

                &:active,
                &--active,
                &--active:hover {
                    background: rgba(var(--button-bg-rgb), 0.08);
                    color: functions.v(button-bg);
                    fill: functions.v(button-bg);
                }
            }
        }
    }
}
